package com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.maintenancesystem.basisinfo;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseService;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.utils.requestutil.HttpRequestUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Author: YangYu
 * @ClassName: ItemService
 * @Date: Created in 10:02 2020/12/22
 * @Description: 项目服务
 */
@Service
@Slf4j
public class ItemService extends BaseService {

    /**
     * @Author YangYu
     * @Description 项目分页列表
     * @Date Created in 10:10 2020/12/22
     * @Param [jsonParam]
     */

    public RespEntity itemPagList(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","itemPagList","item");
    }

    /**
     * @Author YangYu
     * @Description 项目新增
     * @Date Created in 14:55 2020/12/23
     * @Param [jsonParm]
     */

    public RespEntity add(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","add","item");
    }

    /**
     * @Author YangYu
     * @Description 项目更新
     * @Date Created in 15:17 2020/12/23
     * @Param [jsonParam]
     */

    public RespEntity update(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","update","item");
    }

    /**
     * @Author YangYu
     * @Description 项目详情
     * @Date Created in 15:35 2020/12/23
     * @Param [JsonParam]
     */

    public RespEntity detail(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","detail","item");
    }

    /**
     * @Author YangYu
     * @Description 项目删除
     * @Date Created in 10:33 2020/12/24
     * @Param [jsonParam]
     */

    public RespEntity delete(JSONObject jsonParam) {
        //处理支持form-data和json两种方式
        jsonParam = HttpRequestUtil.commonHttpRequestParamConvert(getRequest());
        return restJava(jsonParam,"basisInfo","delete","item");
    }
}
